package cn.biplam.front.template.main.page;

import cn.biplam.common.wrapper.ErrorMessage;
import cn.biplam.common.wrapper.UserInfo;
import cn.biplam.front.html.HtmlDiv;
import cn.biplam.front.html.HtmlPage;
import cn.biplam.front.html.HtmlText;
import cn.biplam.front.template.control.pop.Alert;
import cn.biplam.front.template.control.pop.PopArith;
import cn.biplam.front.template.control.pop.PopMenu;
import cn.biplam.front.template.control.pop.PopView;
import cn.biplam.front.template.control.pop.Popup;
import cn.biplam.front.template.control.pop.Prompt;
import cn.biplam.front.template.control.pop.PopLevel.PopMenu_Layer;
import cn.biplam.front.template.control.pop.PopLevel.Popup_Layer;
import cn.biplam.front.template.control.pop.PopLevel.Prompt_Layer;

/**
 * 页面弹出窗口设置
 * @author WangSong 2009-12-7下午04:50:01
 * @version 1.0
 */
public class PagePop {
	
	public static void setPop(HtmlPage page,UserInfo mUser,String sHomeUrl) throws ErrorMessage{
		/**放入系统信息确认框容器*/
		page.put(new Alert("alert",sHomeUrl,mUser,"").get());
		
		/**放入系统弹出窗口容器(7个)*/
		Popup_Layer layer = null;
		for(int i=1;i<=7;i++){
			try{
				layer = Popup_Layer.valueOf("Popop_"+i);
			}catch(Exception e){
				throw new ErrorMessage(e,"弹出窗口层次错误");
			}
			page.put(new Popup("syspop"+Integer.toString(i),sHomeUrl,mUser,"",layer).get());
		}
		
		/**放入树的右键菜单容器*/
		page.put(new HtmlDiv("rmpop","rmm"));
		/** 放入tip容器 */
		page.put(new HtmlText("tip","sh"));
		/** 放入Prompt容器 */
		page.put(new Prompt("prompt",sHomeUrl,mUser,Prompt_Layer.Prompt).get());
		/**放入下拉框容器*/
		page.put(new HtmlDiv("selectpop","selO1"));
		/** 放入PromptView容器 */
		page.put(new PopView("popview",sHomeUrl,mUser).get());
		/** 放入PromptMenu容器 */
		page.put(new PopMenu("popmenu",sHomeUrl,mUser,PopMenu_Layer.Frame).get());
		/**放入PopFloat*/
		page.put(new PopArith("popfloat",sHomeUrl,mUser,"").get());
	}
}
